Jonas Dreßler [Thu, 24 Feb 2022 18:35:06 +0000 (19:35 +0100)]
status/bluetooth: Clear list of connected signals on adapter changes
With the porting of gnome-bluetooth to the new GListModel API the
behavior regarding removing adapters changed: It now no longer
guarantees to emit "device-removed" signals for the paired devices when
the adapter gets removed.
This means we need to do that ourselves now, so clear the list of
connected signals when the default adapter changes.
Jonas Dreßler [Thu, 24 Feb 2022 17:57:22 +0000 (18:57 +0100)]
Revert "status/bluetooth: Bail out and hide UI when there's no adapter"
Turns out this broke showing the bluetooth menu entry for adapters which
rely on the had-devices-setup property being set while turned off. These
adapters are completely removed from the system by the firmware after
powering them off, so in that case there is no default adapter anymore,
although we still want to show the menu.
Jonas Dreßler [Wed, 23 Feb 2022 15:23:02 +0000 (16:23 +0100)]
overview: Don't expect time argument from drag-end signal
We actually don't get a time from the xdndHandler when it emits
drag-end, so we fail right now when calling
workspaceManager.get_workspace_by_index(time).
Florian Müllner [Tue, 22 Feb 2022 20:16:52 +0000 (21:16 +0100)]
workspaceAnimation: Fix warning on restacking
Only workspace groups that are associated with a workspace have a
background. As a result, when restacking window previews we end up
passing `undefined` to clutter_actor_set_child_above_sibling()
instead of null, triggering a warning.
Florian Müllner [Sun, 29 Mar 2020 21:51:13 +0000 (23:51 +0200)]
cleanup: Use new indentation style for object literals
We have made good progress on object literals as well, although there
are still a lot that use the old style, given how ubiquitous object
literals are.
But the needed reindentation isn't overly intrusive, as changes are
limited to the object literals themselves (i.e. they don't affect
surrounding code).
And given that object literals account for quite a bit of the remaining
differences between regular and legacy rules, doing the transition now
is still worthwhile.
Florian Müllner [Fri, 27 Mar 2020 13:18:34 +0000 (14:18 +0100)]
cleanup: Use new indentation style for arrays
We've made some progress on transitioning to the modern indentation
style, and for arrays the legacy style is now rare enough to make
a bulk transition feasible.
Florian Müllner [Tue, 24 Mar 2020 04:02:20 +0000 (05:02 +0100)]
cleanup: Stop using string concatenation
It's unfortunate that we cannot fully embrace template strings, but
we aren't limited to "legacy" formatting either; replace the last
remaining places where we still use string concatenation to reduce
the difference between regular and legacy style a bit.
kyte [Mon, 21 Feb 2022 14:36:50 +0000 (20:06 +0530)]
workspacesView: Add Home and End keys for workspace navigation
This commit adds support for Home and End keys to move
to the first and last workspace respectively.
Previously only Page_Up and Page_Down were recognized
to move one workspace at a time in overview mode.
Björn Daase [Tue, 15 Feb 2022 10:21:48 +0000 (11:21 +0100)]
dateMenu: Don't manipulate passed events
The event passed to formatEventTime() is reused at a later point.
Therefore, we are not allowed to manipulate the event directly.
This fixes an issue where the user clicks on a multi-day all-day event
the second time before the event gets garbage collected and the event
then is one day shorter.
Sebastian Keller [Sun, 20 Feb 2022 15:53:43 +0000 (16:53 +0100)]
workspacesView: Disable workspace switching while in search
WorkspacesDisplay connects to key-press-event on the stage to switch
workspaces when page up or down is pressed and nothing else intercepts
these keys. This means that it is still possible to switch workspaces
while they are hidden behind the search.
So only allow these keybinding while the WorkspacesDisplay is reactive
which gets updated by ControlsManager depending on whether there is an
active search or not. Also set it as initially reactive, because
otherwise the keybindings would only work after performing an initial
search.
Jonas Dreßler [Fri, 18 Feb 2022 13:13:59 +0000 (14:13 +0100)]
parentalControlsManager: Be less verbose on the logs
There's a few things that are really unncessary to log without any
debugging enabled, for example "Getting parental controls for user", so
remove that.
Other things can be useful, so use console.debug() to log those.
Especially the warning in showAppInfo() we don't want log by default as
it spills tons of messages during shell startup (the async
initialization of the malcontent manager takes some time).
While at it, also make the !HAVE_MALCONTENT message a bit more accurate.
Jonas Dreßler [Mon, 31 Jan 2022 22:40:39 +0000 (23:40 +0100)]
status/bluetooth: Bail out and hide UI when there's no adapter
While _sync() does already handle the case where there's no adapter just
fine (hiding the item and the indicator), let's make the handling a bit
more obvious and add an explicit check for !this._adapter where we bail
out and hide the UI.
Jonas Dreßler [Tue, 18 Jan 2022 10:14:47 +0000 (11:14 +0100)]
status/bluetooth: Use BlueZ state to determine whether bluetooth is on
There's two ways bluetooth can be powered off/on for us: One way is to
go via airplane mode (which uses rfkill), and the second way is to tell
BlueZ to turn off the device. Now rfkill always has the final say on
whether bluetooth is off, BlueZ OTOH has the final say on whether
bluetooth is on.
This means when we want to know whether bluetooth is turned on, we only
have to ask BlueZ, so simply read this._client.default_adapter_powered
for that.
For turning bluetooth on or off we use rfkill, but when turning it on,
make sure it's turned on in Bluez, too.
FTR, this is exactly the same way the Bluetooth panel in Settings
handles this.
Jonas Dreßler [Wed, 16 Feb 2022 12:07:34 +0000 (13:07 +0100)]
st/scroll-view: Don't queue redraw in update_fade_effect()
ClutterEffects are responsible for queueing redraws when their
properties change (and StScrollViewFade is a good citizen already), also
Clutter itself should queue a redraw when adding/removing an effect.
Users of Clutter should never have to queue redraws themselves (unless
they're implementing a custom ClutterEffect or ClutterContent), so don't
queue a redraw here.
Jonas Dreßler [Wed, 16 Feb 2022 11:56:49 +0000 (12:56 +0100)]
st/scroll-view: Only update fade effect on CSS changes if CSS sets it
The fade effect can also be added to the scroll view programatically
instead of using CSS via the st_scroll_view_update_fade_effect() API.
We make use of this API in the appDisplay, but since commit ba547ec1d
the fade margins get overridden to 0.0 from the ::style-changed handler.
Fix this by only setting the fade margins when CSS actually defines a
custom vfade/hfade offset.
Jonas Dreßler [Wed, 16 Feb 2022 19:04:03 +0000 (20:04 +0100)]
dash: Subtract vertical margins from availHeight
The vertical margins are part of this._maxHeight, so we need to subtract
it in order to propery limit icon sizes when the available height is too
small.
Jonas Dreßler [Wed, 16 Feb 2022 19:02:48 +0000 (20:02 +0100)]
overviewControls: Factor in margin-bottom for dash startup animation
We set a margin-bottom on the dash to give it some margin towards the
monitor edge, we need to factor in this margin when moving it outside of
the monitor for our animation.
Sam Hewitt [Mon, 7 Feb 2022 18:22:40 +0000 (14:52 -0330)]
theme: Stylesheet papercuts and other visual fixes
- remove tiled preview corners; merge with misc.scss
- sync general label styles from libadwaita
- use variables in ibus css
- remove redundant spacing variable as its equal to padding
- use more global styles in screenshot css
- tidy up entry styles
- cleanup the networks dialog stylesheet
- make colours less dark
- cleanup the popover stylesheet
- cleanup the mixins for tiles and overview icons
- adjust the button style definitions on checked style
- add osd button definitions
Jonas Dreßler [Sun, 17 Nov 2019 23:44:36 +0000 (00:44 +0100)]
st/widget: Emit "style-changed" on all theme changes
Since now the resource consumption of the "style-changed" signal
handlers should be significantly lower, we can start emitting the signal
in all cases again as it was originally intended. This fixes some small
visual issues, like the battery percentage in the panel only being shown
on hover or updating the size of StIcons on scale-factor changes.
Jonas Dreßler [Fri, 5 Mar 2021 11:49:36 +0000 (12:49 +0100)]
st/label: Compare shadow spec before invalidating shadow on style change
Just like with the last commit for StEntry, check whether the text
shadow actually changed before invalidating the pipeline on style
changes of StLabel.
Jonas Dreßler [Fri, 5 Mar 2021 11:35:26 +0000 (12:35 +0100)]
st/entry: Compare shadow spec before invalidating shadow on style change
Instead of doing a lot of useless work every time we receive the
style-changed signal, only invalidate our text shadow pipeline in case
the shadow actually changed.
Jonas Dreßler [Fri, 5 Mar 2021 11:46:00 +0000 (12:46 +0100)]
st/label: Invalidate text shadow on style changes to ClutterText
Just like with the last commit, listen to some ClutterText property
changes to catch style changes that were trigerred by
_st_set_text_from_style() and invalidate the shadow spec on changes.
Jonas Dreßler [Fri, 5 Mar 2021 11:17:07 +0000 (12:17 +0100)]
st/entry: Invalidate text shadow on style changes to ClutterText
We update a few properties of ClutterText when the CSS changes via
_st_set_text_from_style() (which we call when receiving the
style-changed signal).
Right now we simply invalidate the text shadow every time we receive the
style-changed signal, but we're going to change that with the next
commits. To ensure the shadow still gets invalidated on CSS changed that
might affect the shadow, listen to a bunch of property changes that will
get notified when any property that affects the shadow changes.
Carlos Garnacho [Sun, 13 Feb 2022 13:05:41 +0000 (14:05 +0100)]
popupMenu: Avoid open state reentrancy in dummy menus
Dummy menus may emit ::open-state-changed multiple times for
the same state. Avoid doing that so that the PopupMenuManager
is happy not having to handle reentrancy.
Florian Müllner [Wed, 26 Jan 2022 00:26:44 +0000 (01:26 +0100)]
workspaceSwitcherPopup: Drop direction parameter
The original popup included arrows that indicated the direction of
the switch. We stopped doing that a long time ago, and ever since
the popup has only indicated active vs. non-active workspaces.
Romain Vigier [Tue, 18 Jan 2022 10:19:54 +0000 (11:19 +0100)]
extensions-app: Move headerbar content to the main view
With the new borderless style of libadwaita, the global switch in the headerbar
did not look good. Moving it to the main view is the opportunity to also move
the content of the information popover.
The indicator shows the recording duration and lets the user stop it on
click. It is more discoverable than the stop entry in the aggregate
menu.
The class extends ButtonBox directly rather than Button because Button
does nothing that it uses, and actually causes issues with its dummy
menu (its vfunc_hide() throws an "open-state-changed: Error: incorrect
pop").
The menu-set signal declaration is required by the panel.
The screencast is stopped upon button press in vfunc_event(), which
matches PanelMenu.Button's input handling.
Florian Müllner [Mon, 7 Feb 2022 13:09:13 +0000 (14:09 +0100)]
ci: Stop prohibiting template strings in files with translations
It has been nearly two years since the last regression reported in
https://savannah.gnu.org/bugs/?func=detailitem&item_id=50920 has been
fixed, and no further regressions were reported in the meantime.
It looks therefore safe enough to not restrict ourselves, and start
allowing templates for all non-translatable strings again.
In a subsequent commit we will add a function to open the screenshot UI
in the screencast mode. This argument will allow us to do that without
resorting to accessing private fields from the outside.
screenshot: Connect shot/cast toggle with bind_property
This way we don't need to uncheck the other button manually, and it also
allows switching the mode by setting the other button's checked to
false, and not just by setting the target mode's button to true. An
example clean-up can be seen in the "V" key handler.
We will re-use the same modes for more bindings in subsequent commits.
Also, while we're at it, invert the modes, to emphasize where the
screenshot UI cannot be used, rather than where it can be used.
Florian Müllner [Thu, 10 Feb 2022 17:18:34 +0000 (18:18 +0100)]
ci: Include .ui files in POTFILES check
As the previous commit shows, just checking source files isn't
enough. Extending the existing check to .ui files should make
sure that we catch that kind of breakage in the future before
it hits translators.